<template>
  <view class="radio" :class="{ checked }">
    <view class="img"></view>
    <text class="name" v-if="name">{{ name }}</text>
  </view>
</template>

<script>
export default {
  props: {
    name: {
      type: String,
      default: "",
    },
    checked: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="stylus" scoped>
.radio {
  display: inline-block;

  &.checked {
    .img {
      background-image: url('');
    }
  }

  .img {
    width: 40rpx;
    height: 40rpx;
    border-radius: 40rpx;
    background-image: url('');
    background-size: cover;
  }
}
</style>